package com.dogdays.common.dao.impl;

import com.dogdays.common.dao.VertxDao;
import io.vertx.core.Vertx;
import org.jooq.Configuration;
import org.jooq.Table;
import org.jooq.UpdatableRecord;
import org.jooq.impl.DAOImpl;

/**
 * Created by wuban on 2017/3/20.
 */
public abstract class VertxDaoImpl<R extends UpdatableRecord<R>, P, T> extends DAOImpl<R, P, T> implements VertxDao<R, P, T> {

    private io.vertx.core.Vertx vertx;

    public VertxDaoImpl(Table<R> table, Class<P> type) {
        super(table, type);
    }

    public VertxDaoImpl(Table<R> table, Class<P> type, Configuration configuration, Vertx vertx) {
        super(table, type, configuration);
        this.vertx = vertx;
    }

    @Override
    public io.vertx.core.Vertx vertx() {
        return this.vertx;
    }

    @Override
    public void setVertx(Vertx vertx) {
        this.vertx = vertx;
    }
}
